Cuteeditor textbox and jquery

Last post 05-03-2016, 1:42 PM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  04-29-2016, 8:44 AM 83289

    Cuteeditor textbox and jquery

     I am using cuteeditor textbox (version 6.7) in my project. while loading the page I am able to assign the default value to cuteeditor textbox by the jquery code  $("#rtbRouteJobComments").val(). But when during some action on page, I wanted to change the text in the cuteeditor by the same code as above. But that is not happening.

     

    Any help is appreciated. 

  •  05-02-2016, 12:48 PM 83290 in reply to 83289

    Re: Cuteeditor textbox and jquery

    hi,

     

    please refer to the javascript api at http://cutesoft.net/developer+guide/scr/JavaScript-API.htm  and use the "getHTML()" and "SetHTML()" to get/set the content for editor.

     

    regards,

     

    Ken 

  •  05-03-2016, 10:29 AM 83292 in reply to 83290

    Re: Cuteeditor textbox and jquery

     Thanks for the reply.. Do we need to include any script file related to cuteeditor in the page. The setHTML lines in javasctipt doesn't work it gives "object doesn't support this method error'.

    I am using WOLabeledCuteTextBox
    in my project.

  •  05-03-2016, 1:42 PM 83293 in reply to 83292

    Re: Cuteeditor textbox and jquery

    hi,

     

    please refer to the document again, you need to get the editor instance first and use that api. you can try the example page below.

     

    1. <%@ Page Language="C#" ValidateRequest="false" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4. <html>  
    5. <head>  
    6.     <title>example </title>  
    7. </head>  
    8. <body>  
    9.     <form id="Form1" runat="server">  
    10.         <CE:Editor ID="Editor1" runat="server">  
    11.         </CE:Editor>  
    12.         <input type="button" value="get editor content" onclick="GetContent()" />  
    13.          <input type="button" value="set content" onclick="SetContent()" />  
    14.     </form>  
    15. </body>  
    16. </html>  
    17. <script type="text/javascript">  
    18. function GetContent()  
    19. {  
    20.     var editor1 = document.getElementById('<%= Editor1.ClientID%>');  
    21.     alert(editor1.getHTML());  
    22. }  
    23. function SetContent()  
    24. {  
    25.      var editor1 = document.getElementById('<%= Editor1.ClientID%>');  
    26.      editor1.SetHTML("this is a test");  
    27. }  
    28. </script>  
     

    Regards,

     

    Ken 

View as RSS news feed in XML